package br.com.hotel.dao;

import java.util.ArrayList; 
import java.util.List;

import br.com.hotel.entity.Preco;
import br.com.hotel.entity.ServiceEstadia;

public class ServiceEstadiaDAO extends GenericJpaRepository<ServiceEstadia, Long>{

	public List<ServiceEstadia> diaria;
	public ServiceEstadiaDAO() throws ClassNotFoundException{
		createEntityManager();
	}
	
	public List<ServiceEstadia> getServiceEstadias(){
		
		return findAll();
	}
	
public List<ServiceEstadia> getServiceEstadias(Long estadiaId){
	javax.persistence.Query query = getEntityManager().createQuery("SELECT  p  FROM ServiceEstadia p WHERE p.estadia.Id="+estadiaId);
	return query.getResultList();
		
	}
	
}